var key = CryptoJS.enc.Utf8.parse("十六位十六进制数作为秘钥");
var iv = CryptoJS.enc.Utf8.parse('十六位十六进制数作为秘钥偏移量');

function Encrypt(word) {
	srcs = CryptoJS.enc.Utf8.parse(word);
	var encrypted = CryptoJS.AES.encrypt(srcs, key, {
		iv: iv,
		mode: CryptoJS.mode.CBC,
		padding: CryptoJS.pad.Pkcs7
	});
	return encrypted.ciphertext.toString().toUpperCase();
}

function Decrypt(word) {
	var encryptedHexStr = CryptoJS.enc.Hex.parse(word);
	var srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
	var decrypt = CryptoJS.AES.decrypt(srcs, key, {
		iv: iv,
		mode: CryptoJS.mode.CBC,
		padding: CryptoJS.pad.Pkcs7
	});
	var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
	return decryptedStr.toString();
}

//var mm = Encrypt(2);
//console.log(mm);
//var jm = Decrypt(mm);
//console.log(jm);

//aes传参解密